Fix Alarm Join Query Projection Mapping#23
Conversation
- Updated `ClockProvider.java` to include unqualified mappings for `VIBRATION_PATTERN`, `HOLIDAY_OPTION`, and `MISSED_ALARM_REPEAT_LIMIT` in `sAlarmsWithInstancesProjection`. - Cleaned up `Alarm.java` by removing the redundant `HOLIDAY_OPTION` from `QUERY_ALARMS_WITH_INSTANCES_COLUMNS`. - Updated index constants in `Alarm.java` to match the corrected column array, ensuring proper data retrieval from cursors. - Verified consistency in `AlarmInstance.java` and confirmed successful compilation. Co-authored-by: gx-bangsong <146644201+gx-bangsong@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR fixes a
java.lang.RuntimeException: An error occurred while executing doInBackground()caused byjava.lang.IllegalArgumentException: Invalid column holidayOptionwhen querying thealarms_with_instancesURI.The issue was two-fold:
SQLiteQueryBuilderinClockProviderwas set with a projection map (sAlarmsWithInstancesProjection) that only contained fully qualified keys (e.g.,alarm_templates.holidayOption), while the caller (Alarm.java) was requesting the unqualifiedholidayOptioncolumn.Alarm.QUERY_ALARMS_WITH_INSTANCES_COLUMNScontained a duplicate entry forHOLIDAY_OPTION, which could lead to cursor index mismatches.Changes:
ClockProvider.java, added "naked" (unqualified) column mappings tosAlarmsWithInstancesProjectionfor the new setting columns (vibrationPattern,holidayOption, andmissed_alarm_repeat_limit).Alarm.java, removed the redundantHOLIDAY_OPTIONfrom the end ofQUERY_ALARMS_WITH_INSTANCES_COLUMNS.ALARM_JOIN_INSTANCE_COLUMN_COUNTinAlarm.javato reflect the array cleanup.Alarm.javato point toalarm_templates.Verified by successful compilation and code review of the mapping logic.
PR created automatically by Jules for task 1859529930361523113 started by @gx-bangsong